'''
作者：小鹿
个人网站：https://www.siena.zone
创作日期：2020年5月
'''
import cv2 as cv
import numpy as np

def WM_Convert(img):
    imgRead = cv.imread(img)
    imgHSV = cv.cvtColor(imgRead, cv.COLOR_BGR2HSV)
    h, s, v = cv.split(imgHSV)
    ss = np.zeros(imgRead.shape[:2],dtype="uint8")
    imgHSV_new = cv.merge([h, ss, v])
    imgBGR = cv.cvtColor(imgHSV_new, cv.COLOR_HSV2BGR)

    print(imgBGR.shape[2])

    return imgBGR

if __name__ == '__main__':
    src = './img/Cropped_Png.png'
    dst = WM_Convert(src)
    cv.imshow('show wm', dst)
    cv.waitKey(0)
    cv.destroyAllWindows()